package com.gitee.zycra.union.api.common.vo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author zycra
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class MockInterfaceVO {

    /**
     * 接口ID
     */
    private Long interfaceId;

    /**
     * 目录名称
     */
    private String folderName;

    /**
     * 接口名称
     */
    private String interfaceName;

    /**
     * 期望集合
     */
    private List<MockInterfaceCaseVO> caseList;

    public static MockInterfaceVO buildMockInterfaceVO(MockTemplateInterfaceVO mockTemplateInterfaceVO, List<MockInterfaceCaseVO> caseList) {
        if (mockTemplateInterfaceVO == null) {
            return null;
        }
        return new MockInterfaceVO()
                .setInterfaceId(mockTemplateInterfaceVO.getInterfaceId())
                .setInterfaceName(mockTemplateInterfaceVO.getInterfaceName())
                .setFolderName(mockTemplateInterfaceVO.getFolderName())
                .setCaseList(caseList);
    }
}
